#ifndef GAMESCENE_H
#define GAMESCENE_H



#include"boom.h"
#include"helper.h"
#include"brick.h"
#include"hardbrick.h"
#include"player.h"
#include"ball.h"
#include"setscene.h"
#include"victoryscene.h"
#include"defeatscene.h"
#include"brick.h"
#include"stock.h"
#include "ui_gamescene.h"
//gamescene，游戏界面


namespace Ui {
class GameScene;
}

class GameScene : public QWidget,public Ui::GameScene
{
    Q_OBJECT

public:


    explicit GameScene(QWidget *parent = nullptr);
    ~GameScene();

    void inite_game_scene(); 
    void paintleft();
    void paintright();
    void paintball();
    void set_shot();
    void collisionDetection();

    int player_life;
    int brick_num;
    Player p1;
    brick *enemies[100];
    Ball m_ball;
    bool stopped;
    Boom m_booms[100];


public slots:
    void receivestart();

protected:

     void keyPressEvent(QKeyEvent *event);
     void keyReleaseEvent(QKeyEvent *event);

     void paintEvent(QPaintEvent *);

protected:

    bool loser_flag;

signals:
    void move_player_left();
    void move_player_right();
    void repaintBall();
    void set_has_shot();
    void timestop();
    void timestart();
    void victory();
    void defeat();
};

#endif // GAMESCENE_H
